#include <stdio.h>
#include "event.h"

void handle_event(xcb_generic_event_t *evt)
{
    static int flag = 0;

    printf("[ev %d] ", flag++);

    switch (XCB_EVENT_RESPONSE_TYPE(evt)) {
        case XCB_MAP_REQUEST:
            printf("map request\n");
            break;
        case XCB_DESTROY_NOTIFY:
            printf("destroy notify\n");
            break;
        case XCB_UNMAP_NOTIFY:
            printf("unmap notify\n");
            break;
        case XCB_CLIENT_MESSAGE:
            printf("client message\n");
            break;
        case XCB_CONFIGURE_REQUEST:
            printf("config request\n");
            break;
        case XCB_CONFIGURE_NOTIFY:
            printf("config notify\n");
            break;
        case XCB_PROPERTY_NOTIFY:
            printf("property notify\n");
            break;
        case XCB_ENTER_NOTIFY:
            printf("enter notify\n");
            break;
        case XCB_MOTION_NOTIFY:
            printf("motion notify\n");
            break;
        case XCB_BUTTON_PRESS:
            printf("button\n");
            break;
        case XCB_FOCUS_IN:
            printf("focus in\n");
            break;
        case XCB_MAPPING_NOTIFY:
            printf("mapping notify\n");
            break;
        case XCB_EXPOSE:
            printf("expose\n");
            break;
        case 0:
            // process_error(evt);
            printf("error\n");
            break;
        default:
            printf("default\n");
            break;
    }
}
